package com.example.androidxdemo

import android.app.Application
import com.blankj.utilcode.util.PermissionUtils
import com.example.androidxdemo.viewModel.FunctionViewModel

class App : Application() {

    override fun onCreate() {
        super.onCreate()
        app = this
        initFunctions()
        funtions
        PermissionUtils.isGranted()
    }

    private fun initFunctions() {
        funtions.add(FunctionViewModel("内存泄漏", 0))
        funtions.add(FunctionViewModel("navigation管理fragment堆栈，附带全局操作", 1))
        funtions.add(FunctionViewModel("viewmodel+livedata模拟登录过程，即条件导航", 2))
        funtions.add(FunctionViewModel("Room", 3))
        funtions.add(FunctionViewModel("locationservice+lifecycle", 4))
        funtions.add(FunctionViewModel("蓝牙通讯", 5))
    }


    companion object {
        private var app: App? = null

        var funtions = mutableListOf<FunctionViewModel>()


        fun getMe(): App? {
            return app
        }


    }

}